//
//  YSShareBar.m
//  Yueshi
//
//  Created by Northwan on 15/8/18.
//  Copyright (c) 2015年 悦食中国. All rights reserved.
//

#import "YSProductNavgationShareBar.h"
#import "WXClient.h"
#import "YSShareView.h"
#import "CustomShowView.h"

@interface YSProductNavgationShareBar()
@end
@implementation YSProductNavgationShareBar

+(instancetype)shareBar{
    return [[[NSBundle mainBundle]loadNibNamed:@"YSProductNavgationShareBar" owner:nil options:nil]lastObject];
}

- (IBAction)tapBack:(id)sender {
    [self.viewController.navigationController popViewControllerAnimated:YES];
}

- (IBAction)shareWx:(id)sender {
    [[WXClient sharedClient]sendLinkContentWithURlStr:_shareModel.url andTitle:_shareModel.title andImageURL:_shareModel.imageUrl andDescription:_shareModel.subTile andScene:0];
}

- (IBAction)shareMore:(id)sender {
    YSShareView *sv = [[YSShareView alloc]init];
    [sv setWidth:SCREENW];
    [sv setShareModel:_shareModel];
    CustomShowView *alertView =  [[CustomShowView alloc]initWithCustomView:sv location:CustomShowViewLocationTopType];
    [alertView showWithAnim:YES];
}

-(void)setShareModel:(YSShareModel *)shareModel{
    _shareModel = shareModel;
}

@end
